a11b5c789d7fcfca359d22b0c33a333eccfd8b4e,source/com/intellij/xml/util/AnchorReference.java,AnchorReference,resolveInner,#,61
Before Change
private PsiElement resolveInner() {
final PsiElement[] result = new PsiElement[1];
XmlUtil.processXmlElements(
getFile(),
new PsiElementProcessor() {
public boolean execute(final PsiElement element) {
final String anchorValue = getAnchorValue(element);
if (anchorValue!=null && anchorValue.equals(myAnchor)) {
final XmlTag xmlTag = (XmlTag)element;
XmlAttribute attribute = xmlTag.getAttribute("id", null);
if (attribute==null) attribute = xmlTag.getAttribute("name",null);
result[0] = attribute.getValueElement();
return false;
}
return true;
}
},
true
);
return result[0];
}
After Change
final PsiElement[] result = new PsiElement[1];
final XmlFile file = getFile();
if (file != null) {
processXmlElements(
file.getDocument().getRootTag(),
new PsiElementProcessor() {
public boolean execute(final PsiElement element) {
final String anchorValue = getAnchorValue(element);
if (anchorValue!=null && anchorValue.equals(myAnchor)) {
final XmlTag xmlTag = (XmlTag)element;
XmlAttribute attribute = xmlTag.getAttribute("id", null);
if (attribute==null) attribute = xmlTag.getAttribute("name",null);
result[0] = attribute.getValueElement();
return false;
}
return true;
}
}
);
}
return result[0];